const inquirer = require('inquirer')
const config = require('../../config')
const downloadFun = require('./download')
const myAction = async (name, other) => {
  // 使用create命令之后要做什么；也就是命令行的执行逻辑代码
  const prompt = inquirer.createPromptModule()
  const answers = await prompt([
    {
      type: 'list',
      name: 'framwork',
      message: '请选择一个框架',
      choices: config.framwork
    }
  ])
  downloadFun(config.framworkUrl[answers.framwork], name)
}

module.exports = myAction
